powered by
mahala(x, mu, sigma, ischol)
dista, colmeans
x <- matrix( rnorm(1000 * 200), ncol = 200 ) m <- colmeans(x) s <- cov(x) system.time( a1 <- mahala(x, m, s) ) system.time( a2 <- mahalanobis(x, m, s) ) all.equal(as.vector(a1), as.vector(a2))
Run the code above in your browser using DataLab